<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:83:"F:\phpStudy_NEW\PHPTutorial\WWW\public/../application/index\view\index\catalog.html";i:1523177850;s:73:"F:\phpStudy_NEW\PHPTutorial\WWW\application\index\view\public\header.html";i:1521189289;s:70:"F:\phpStudy_NEW\PHPTutorial\WWW\application\index\view\public\nav.html";i:1530521179;s:73:"F:\phpStudy_NEW\PHPTutorial\WWW\application\index\view\public\footer.html";i:1520580169;}*/ ?>
<!-- 页眉 -->
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="referrer" content="always">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
	<title>国外文献数据库检索系统</title>
	<link rel="stylesheet" href="/static/layui/css/layui.css">
	<script src="/static/layui/layui.js"></script>
	<!--[if lt IE 9]>
	<script src="/static/ie8/html5.min.js"></script>
	<script src="/static/ie8/respond.min.js"></script>
	<![endif]-->
	<style>
		body{overflow-y: scroll;}
	</style>
</head>
<body>
<!-- 导航 -->
<ul class="layui-nav">
  <li class="layui-nav-item <?php if($type == 'ALL'): ?>layui-this<?php endif; ?>"><a href="/">首页</a></li>
  <li class="layui-nav-item <?php if($type == 'J'): ?>layui-this<?php endif; ?>"><a href="<?php echo url('index/journal'); ?>">期刊文献</a></li>
  <li class="layui-nav-item <?php if($type == 'C'): ?>layui-this<?php endif; ?>"><a href="<?php echo url('index/conference'); ?>">会议文献</a></li>
  <li class="layui-nav-item <?php if($type == 'R'): ?>layui-this<?php endif; ?>"><a href="<?php echo url('index/report'); ?>">科技报告</a></li>
  <li class="layui-nav-item <?php if($type == 'D'): ?>layui-this<?php endif; ?>"><a href="<?php echo url('index/dissertation'); ?>">学位论文</a></li>
  <li class="layui-nav-item">
    <a href="javascript:;">其他分类</a>
    <dl class="layui-nav-child"> <!-- 二级菜单 -->
      <dd><a href="<?php echo url('index/compile'); ?>">汇编文献</a></dd>
      <dd><a href="<?php echo url('index/standard'); ?>">技术标准</a></dd>
      <dd><a href="<?php echo url('index/patent'); ?>">专利文献</a></dd>
      <dd><a href="<?php echo url('index/monograph'); ?>">专著文献</a></dd>
      <dd><a href="<?php echo url('index/tool'); ?>">参考工具</a></dd>
    </dl>
  </li>
  <li class="layui-nav-item">
    <a href="javascript:;">文摘数据</a>
    <dl class="layui-nav-child"> <!-- 二级菜单 -->
      <dd><a href="<?php echo url('index/ntis'); ?>">NTIS</a></dd>
      <dd><a href="<?php echo url('index/inspec'); ?>">INSPEC</a></dd>
      <dd><a href="<?php echo url('index/ei'); ?>">EI</a></dd>
      <dd><a href="<?php echo url('index/aero'); ?>">AERO</a></dd>
      <dd><a href="<?php echo url('index/kjwz'); ?>">科技文摘</a></dd>
    </dl>
  </li>
  <li class="layui-nav-item <?php if($type == 'CA'): ?>layui-this<?php endif; ?>"><a href="<?php echo url('index/catalog'); ?>">分库检索</a></li>
</ul>

<ul class="layui-nav layui-layout-right">
  <li class="layui-nav-item">
    <a href="">控制台<span class="layui-badge">8</span></a>
  </li>
  <li class="layui-nav-item">
    <a href="">个人中心<span class="layui-badge-dot"></span></a>
  </li>
  <li class="layui-nav-item" lay-unselect="">
    <a href="javascript:;"><img src="..." class="layui-nav-img">我</a>
    <dl class="layui-nav-child">
      <dd><a href="javascript:;">修改信息</a></dd>
      <dd><a href="javascript:;">安全管理</a></dd>
      <dd><a href="javascript:;">退了</a></dd>
    </dl>
  </li>
</ul>



<!-- 主体 -->
<style type="text/css">
    #search_auto { position: absolute; display: none; z-index: 100; Margin-top: 1px; border: 1px solid #4783EB; padding: 0px;}
    #search_auto ul { margin-bottom: 0px; padding: 0px; list-style-type: none; }
    #search_auto li { background: #FFF; text-align: left; padding-left: 5px; }
    #search_auto li.cls { text-align: right; background: #EFF0EF; padding-right: 5px; }
    #search_auto li a { display: block; cursor: pointer; color: #666; }
    #search_auto li a:hover { text-decoration: none; color: #000;}
</style>
<div class="layui-fluid" id="main">
    <div class="layui-row" style="margin-top: 50px; ">
        <div class="layui-col-md4 layui-col-md-offset4" style="text-align: center">
            <img src="/static/img/logo_b.png" style="border: 0px">
        </div>
    </div>
    <div class="layui-row" style="margin-top: 50px; ">
        <div class="layui-col-md12">
            <form class="layui-form" method="post" action="<?php echo url('Index/Search'); ?>">
                <div class="layui-form-item" style="width: 600px; margin: 0 auto">
                    <div class="layui-input-inline" style="width: 350px;">
                        <input name="keyword" lay-verify="keyword" id="keyword" autocomplete="off" placeholder="请输入搜索关键词" class="layui-input" type="text">
                    </div>
                    <div class="layui-input-inline" style="width: 100px;">
                        <select name="cid" lay-verify="cid" id="lists">
                        </select>
                    </div>
                    <div class="layui-input-inline" style="width: 80px; padding-right: 10px;">
                        <button class="layui-btn" lay-submit="" lay-filter="searchButton">搜一下</button>
                    </div>
                    <div style="width: 348px; margin-top: 39px" id="search_auto"></div>
                </div>
            </form>
        </div>
    </div>

</div>

<!-- 控制脚本 -->
<script src="/static/ie8/jquery.1.11.3.min.js"></script>
<script>
    //一般直接写在一个js文件中
    layui.use(['element', 'layer', 'form'], function(){
        var element = layui.element
            ,form = layui.form
            ,$ = layui.$;

        //自定义验证规则
        form.verify({
            keyword: function(value){
                if(value.length < 3){
                    return '亲，关键词太少了，多输2个字符再试试';
                }
            },
            cid: function(value){
                if(value.length =='' ){
                    return '亲，还没选要查询的数据库呢';
                }
            }
        });

        //获取数据库列表
        $.get('<?php echo url('api/Search/getTableList'); ?>',function (data) {
            if (data != void(0)){
                var $htmlStr = '<option value=""></option>';
                for(var i in data){
                    $htmlStr += '<option value="'+data[i].cid+'">'+data[i].name+'</option>';
                }
                $('#lists').html($htmlStr);
                form.render('select');
            }
        });
    });

    $('.layui-input').keyup(function () {
        $.post('<?php echo url('/api/Search/keyword'); ?>',{
            keyword: $(this).val()
        },function (data) {
            var str = '';
            if (data == void(0)) {
                str = '<li>无类似关键词</li>';
            } else {
                for (var i = 0; i < data.length; i++) {
                    str = str + '<li><a href="javascript:void(0)" onclick="visits(\'' + data[i].keyname + '\')">' + data[i].keyname + '</a></li>';
                }
            }
            str = '<ul>' + str + '<li class="cls"><a href="javascript:void(0)" onclick="$(this).parent().parent().parent().fadeOut(100)">关闭</a></li></ul>';
            $('#search_auto').html(str).css('display', 'block');
        });
    });

    function visits(str) { $('#keyword').val(str); }
</script>
<!-- 页脚 -->
</body>
</html>